//
// Created by Sorel on 2021/3/30.
//

#ifndef BASIC_EAS_CEC_UTILS_HPP
#define BASIC_EAS_CEC_UTILS_HPP

/**
 * @param x : variables
 * @param fitness
 * @param dimension
 */
const double PI = 3.141592653589793;  // define PI value
void object_func(const double *x, double &fitness, int dimension) {
    for (int i = 0; i < dimension; ++i) {
        fitness  = pow(x[i], 2);
    }
    fitness = fitness + 1;
    fitness = 1.0 / fitness;
}

/**
 * CEC 2014 Benchmark
 * @param individual : individual to evaluate
 * @param value : individual value be to stored in
 * @param dimension : dimension of the variables
 * @param individual_num : number of individuals to evaluate, set to 1 by default
 * @param func_num : function number
 */
void cec14_test_func(double *individual, double *value, int dimension, int individual_num, int func_num);
double *OShift, *M, *y, *z, *x_bound;
int ini_flag, n_flag, func_flag, *SS;





#endif //BASIC_EAS_CEC_UTILS_HPP
